From: Daniel De Graaf Date: Fri, 2 Dec 2011 21:46:24 +0000 (-0800) Subject: xsm: always allow setting non-present PTEs X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=65d744c6d56f92401b9d279c9cf8fe618397be0e;p=xen.git xsm: always allow setting non-present PTEs Signed-off-by: Daniel De Graaf --- diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index 2cb3e169c0..80c1f7017f 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -1016,6 +1016,9 @@ static int flask_mmu_normal_update(struct domain *d, struct domain *f, struct domain_security_struct *dsec; u32 fsid; + if ( !(l1e_get_flags(l1e_from_intpte(fpte)) & _PAGE_PRESENT) ) + return 0; + dsec = d->ssid; if ( l1e_get_flags(l1e_from_intpte(fpte)) & _PAGE_RW ) @@ -1053,6 +1056,12 @@ static int flask_update_va_mapping(struct domain *d, struct domain *f, unsigned long mfn; struct domain_security_struct *dsec; + if ( !(l1e_get_flags(pte) & _PAGE_PRESENT) ) + return 0; + + if ( l1e_get_flags(pte) & _PAGE_RW ) + map_perms |= MMU__MAP_WRITE; + dsec = d->ssid; mfn = get_gfn_untyped(f, l1e_get_pfn(pte)); @@ -1060,9 +1069,6 @@ static int flask_update_va_mapping(struct domain *d, struct domain *f, if ( rc ) return rc; - if ( l1e_get_flags(pte) & _PAGE_RW ) - map_perms |= MMU__MAP_WRITE; - return avc_has_perm(dsec->sid, psid, SECCLASS_MMU, map_perms, NULL); }